import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/foundation/key.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/widgets.dart';

class CurperDemo extends StatefulWidget {
  const CurperDemo({Key? key}) : super(key: key);

  @override
  State<CurperDemo> createState() => _CurperDemoState();
}

class _CurperDemoState extends State<CurperDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title:const Text("card 卡片") ,
        centerTitle: true,
      ),
      body: Column(
        children: [
          Text("CupertinoActionSheet组件是Cupertino（ios）风格底部弹出的提示框，一般情况下点击按钮弹出："),
           SizedBox(height: 20),
           RaisedButton(
             onPressed: (){
               showCupertinoModalPopup(
                 context: context, 
                 builder:(context){
                   return CupertinoActionSheet(
                     title: Text("提示"),
                     message: Text("是否要删除当前项"),
                     actions: [
                      CupertinoActionSheetAction(
                         onPressed: (){}, 
                         child: Text("删除"),
                         isDefaultAction: true,  // 文字加粗
                         ),
                      CupertinoActionSheetAction(
                         onPressed: (){}, 
                         child: Text("暂时不删除"),
                         isDestructiveAction: true,  // 文字变红
                         ),
                     ],
                     cancelButton: CupertinoActionSheetAction( // 如果想要一个和其他选项分开的组件，可以使用
                       child: Text("取消"),
                       onPressed: (){},
                     ),
                   );

                 } 
                );
               
             },
             child: Text('点我'),
             )

         
        ],
      ),
    );
    
  }
}